import qs from 'querystring'
import request from '@/utils/request'

const ADD_ADDGOODS = 'goods'
const DEL_GOODS = 'goods/'
function getAdd(params){
    return request({
        url:ADD_ADDGOODS,
        method:'post',
        data:params
    })
}
function getList(params){
    return request({
        url:ADD_ADDGOODS +'?'+qs.stringify(params),
        method:'get'
    })
}
function delGoods(id){
    return request({
        url:DEL_GOODS +id,
        method:'delete'
    })
}
function editGoods(id){
    return request({
        url:DEL_GOODS +id,
        method:'get'
    })
}
function updateGoods(id,params){
    return request({
        url:DEL_GOODS +id,
        method:'put',
        data:params
    })
}
export {getAdd,getList,delGoods,editGoods,updateGoods}